package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main=Thread.currentThread();
        String s=main.getName();
        long b=main.getId();
        System.out.println("name:"+s);
        System.out.println("唯一标识:"+b);
        int priority=main.getPriority();
        System.out.println("优先级："+priority);
        boolean isAlive=main.isAlive();
        System.out.println("是否活着："+isAlive);
        boolean isDaemon=main.isDaemon();
        System.out.println("是否为守护线程:"+isDaemon);
        boolean isInterrupted=main.isInterrupted();
        System.out.println("是否被中断了:"+isInterrupted);
    }
}
